/**
 * Created by ying on 16-8-25.
 */
app.controller('Product_listCtrl', function($scope,$http) {
    $scope.cart=new Cart();
    var count=$scope.cart.get_sum_count();
    $scope.sum_count=count ||0;
    $http.get('../js/goods_information.json').success(function(data){
        $scope.goods_informations = data;
    })
    $scope.add_click_event=function(item){
        var items=new Item(item);
        $scope.cart.get_goods_info(item);
        var pro=new Promotion();
        pro.get_pro_count(item,$scope.cart.goods_info);
        var goods_info= items.get_subtotal($scope.cart.goods_info);
        localStorage.setItem('data',JSON.stringify($scope.cart.goods_info));
        var sum_count=$scope.cart.get_sum_count();
        $scope.sum_count=sum_count;
    }
})